package com.heng.service.a2_InitializingBean接口;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class MyInitializingBean implements InitializingBean {
    /**
     afterPropertiesSet()方法执行的时机先于 其他bean的 静态方法
     */

    // 1. 还是静态方法先执行
    static {
        System.out.println("--=!!");
    }
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("InitializingBean");
    }
}
